package com.euq.entity;

import jakarta.validation.constraints.NotBlank;

import java.util.Date;

public class Task {
    private Long id;
    @NotBlank(message = "名称不能为空")
    private String name;
    private String jobGroup;
    @NotBlank(message = "执行类不能为空")
    private String jobClass;
    private String note;
    @NotBlank(message = "定时规则不能为空")
    private String cron;
    private boolean concurrent;
    private String data;
    private Date execAt;
    private String execResult;
    private boolean disabled;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public @NotBlank(message = "名称不能为空") String getName() {
        return name;
    }

    public void setName(@NotBlank(message = "名称不能为空") String name) {
        this.name = name;
    }

    public String getJobGroup() {
        return jobGroup;
    }

    public void setJobGroup(String jobGroup) {
        this.jobGroup = jobGroup;
    }

    public @NotBlank(message = "执行类不能为空") String getJobClass() {
        return jobClass;
    }

    public void setJobClass(@NotBlank(message = "执行类不能为空") String jobClass) {
        this.jobClass = jobClass;
    }

    public String getNote() {
        return note;
    }

    public void setNote(String note) {
        this.note = note;
    }

    public @NotBlank(message = "定时规则不能为空") String getCron() {
        return cron;
    }

    public void setCron(@NotBlank(message = "定时规则不能为空") String cron) {
        this.cron = cron;
    }

    public boolean isConcurrent() {
        return concurrent;
    }

    public void setConcurrent(boolean concurrent) {
        this.concurrent = concurrent;
    }

    public String getData() {
        return data;
    }

    public void setData(String data) {
        this.data = data;
    }

    public Date getExecAt() {
        return execAt;
    }

    public void setExecAt(Date execAt) {
        this.execAt = execAt;
    }

    public String getExecResult() {
        return execResult;
    }

    public void setExecResult(String execResult) {
        this.execResult = execResult;
    }

    public boolean isDisabled() {
        return disabled;
    }

    public void setDisabled(boolean disabled) {
        this.disabled = disabled;
    }

    @Override
    public String toString() {
        return "Task{" +
                "name='" + name + '\'' +
                ", jobGroup='" + jobGroup + '\'' +
                ", jobClass='" + jobClass + '\'' +
                ", note='" + note + '\'' +
                ", cron='" + cron + '\'' +
                ", concurrent=" + concurrent +
                ", data='" + data + '\'' +
                ", execAt=" + execAt +
                ", execResult='" + execResult + '\'' +
                ", disabled=" + disabled +
                '}';
    }
}
